package com.hoopchina.ui.home;

// import class
import android.content.Context;
import android.database.SQLException;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.database.sqlite.SQLiteDatabase.CursorFactory;

/**
 * CityDatabaseHelper
 * 用于搜索历史记录创建和使用数据库
 * 
 * @author Neusoft
 */
public class CityDatabaseHelper extends SQLiteOpenHelper {

    public CityDatabaseHelper( Context context, String name, CursorFactory factory,
            int version ) {
        super( context, name, factory, version );
    }

    public CityDatabaseHelper( Context context, String name ) {
        this( context, name, 3 );
    }

    public CityDatabaseHelper( Context context, String name, int version ) {
        this( context, name, null, version );
    }

    /*
     * 关闭数据库
     * @see android.database.sqlite.SQLiteOpenHelper#close()
     */
    @Override
    public synchronized void close() {
        super.close();
    }

    /*
     * 打开数据库
     * @see android.database.sqlite.SQLiteOpenHelper#onOpen(android.database.sqlite.SQLiteDatabase)
     */
    @Override
    public void onOpen( SQLiteDatabase db ) {
        super.onOpen( db );
    }

    /*
     * 创建或打开数据库
     * @see
     * android.database.sqlite.SQLiteOpenHelper#onCreate(android.database.sqlite.SQLiteDatabase)
     */
    @Override
    public void onCreate( SQLiteDatabase db ) {
        try {
        	// new thread
            db.execSQL( "create table city_table(cityName varchar(4), cityCode int);" );

            db.execSQL( "insert into city_table(cityName,cityCode) values(\"石家庄\", 251);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"唐山\", 286);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"秦皇岛\", 306);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"邯郸\", 317);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"邢台\", 346);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"保定\", 372);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"张家口\", 406);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"承德\", 428);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"沧州\", 440);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"廊坊\", 471);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"衡水\", 487);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"太原\", 813);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"大同\", 829);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"阳泉\", 842);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"长治\", 846);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"晋城\", 863);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"朔州\", 871);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"晋中\", 881);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"运城\", 898);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"忻州\", 918);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"临汾\", 940);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"吕梁\", 965);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"呼和浩特\", 1168);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"包头\", 1181);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"乌海\", 1197);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"赤峰\", 1202);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"通辽\", 1221);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"鄂尔多斯\", 1234);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"呼伦贝尔\", 1247);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"乌兰察布\", 1267);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"巴彦淖尔\", 1305);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"兴安盟\", 1323);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"沈阳\", 1482);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"大连\", 1501);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"鞍山\", 1517);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"抚顺\", 1528);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"本溪\", 1539);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"丹东\", 1552);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"锦州\", 1562);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"葫芦岛\", 1573);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"营口\", 1583);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"盘锦\", 1593);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"阜新\", 1600);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"辽阳\", 1610);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"铁岭\", 1621);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"吉林\", 1783);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"长春\", 1784);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"四平\", 1814);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"辽源\", 1824);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"通化\", 1831);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"白山\", 1842);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"延边\", 1852);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"哈尔滨\", 1968);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"齐齐哈尔\", 1994);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"鹤岗\", 2019);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"双鸭山\", 2029);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"鸡西\", 2042);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"大庆\", 2056);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"伊春\", 2072);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"牡丹江\", 2097);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"佳木斯\", 2113);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"七台河\", 2127);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"黑河\", 2134);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"绥化\", 2144);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"大兴安岭\", 2160);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"南京\", 2494);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"徐州\", 2514);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"连云港\", 2531);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"淮安\", 2542);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"宿迁\", 2555);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"盐城\", 2563);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"扬州\", 2576);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"泰州\", 2587);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"南通\", 2597);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"镇江\", 2610);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"常州\", 2620);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"无锡\", 2631);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"苏州\", 2645);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"杭州\", 2810);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"宁波\", 2827);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"温州\", 2844);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"嘉兴\", 2861);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"湖州\", 2872);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"绍兴\", 2877);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"金华\", 2887);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"衢州\", 2901);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"舟山\", 2911);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"台州\", 2918);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"丽水\", 2932);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"合肥\", 3073);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"芜湖\", 3084);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"蚌埠\", 3095);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"淮南\", 3102);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"马鞍山\", 3112);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"淮北\", 3119);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"铜陵\", 3126);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"安庆\", 3131);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"黄山\", 3147);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"滁州\", 3158);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"阜阳\", 3171);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"宿州\", 3184);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"巢湖\", 3192);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"六安\", 3200);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"亳州\", 3211);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"池州\", 3218);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"宣城\", 3225);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"福州\", 3373);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"厦门\", 3393);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"三明\", 3404);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"莆田\", 3423);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"泉州\", 3433);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"漳州\", 3452);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"南平\", 3469);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"龙岩\", 3485);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"宁德\", 3496);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"南昌\", 3637);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"景德镇\", 3650);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"萍乡\", 3657);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"九江\", 3665);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"新余\", 3684);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"鹰潭\", 3688);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"赣州\", 3693);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"吉安\", 3721);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"宜春\", 3741);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"抚州\", 3757);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"上饶\", 3774);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"济南\", 3997);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"青岛\", 4011);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"淄博\", 4027);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"枣庄\", 4040);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"东营\", 4048);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"潍坊\", 4056);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"烟台\", 4075);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"威海\", 4094);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"济宁\", 4101);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"泰安\", 4118);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"日照\", 4128);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"莱芜\", 4133);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"临沂\", 4137);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"德州\", 4156);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"聊城\", 4173);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"滨州\", 4186);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"菏泽\", 4197);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"郑州\", 4372);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"开封\", 4392);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"洛阳\", 4408);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"平顶山\", 4431);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"焦作\", 4447);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"鹤壁\", 4461);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"新乡\", 4468);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"安阳\", 4482);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"濮阳\", 4496);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"许昌\", 4504);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"漯河\", 4514);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"三门峡\", 4521);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"南阳\", 4531);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"商丘\", 4551);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"信阳\", 4565);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"周口\", 4581);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"驻马店\", 4597);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"济源\", 4613);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"武汉\", 4812);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"黄石\", 4832);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"襄樊\", 4842);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"十堰\", 4856);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"荆州\", 4869);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"宜昌\", 4882);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"荆门\", 4902);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"鄂州\", 4910);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"孝感\", 4915);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"黄冈\", 4926);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"咸宁\", 4942);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"随州\", 4952);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"恩施\", 4956);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"仙桃\", 4969);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"天门\", 4975);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"潜江\", 4981);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"长沙\", 5162);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"株洲\", 5176);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"湘潭\", 5190);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"衡阳\", 5198);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"邵阳\", 5217);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"岳阳\", 5236);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"常德\", 5250);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"张家界\", 5266);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"益阳\", 5273);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"郴州\", 5281);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"永州\", 5298);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"怀化\", 5315);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"娄底\", 5334);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"湘西\", 5342);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"广州\", 5496);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"深圳\", 5515);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"珠海\", 5525);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"汕头\", 5530);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"韶关\", 5543);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"河源\", 5560);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"梅州\", 5570);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"汕尾\", 5583);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"东莞\", 5588);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"中山\", 5594);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"江门\", 5600);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"佛山\", 5611);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"阳江\", 5622);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"湛江\", 5629);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"茂名\", 5643);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"肇庆\", 5653);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"清远\", 5666);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"潮州\", 5685);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"揭阳\", 5690);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"云浮\", 5698);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"南宁\", 5887);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"柳州\", 5904);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"桂林\", 5918);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"梧州\", 5944);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"北海\", 5954);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"防城港\", 5961);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"钦州\", 5968);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"贵港\", 5975);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"玉林\", 5982);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"百色\", 5992);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"贺州\", 6011);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"河池\", 6018);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"海口\", 6246);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"三亚\", 6253);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"文昌\", 6265);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"万宁\", 6277);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"五指山\", 6283);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"儋州\", 6295);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"成都\", 6693);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"自贡\", 6721);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"攀枝花\", 6731);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"泸州\", 6736);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"德阳\", 6747);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"绵阳\", 6757);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"广元\", 6771);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"遂宁\", 6781);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"内江\", 6786);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"乐山\", 6793);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"南充\", 6809);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"宜宾\", 6823);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"广安\", 6839);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"达州\", 6847);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"眉山\", 6858);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"雅安\", 6868);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"巴中\", 6881);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"资阳\", 6888);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"阿坝\", 6895);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"甘孜\", 6915);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"凉山\", 6943);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"贵阳\", 7231);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"六盘水\", 7247);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"遵义\", 7254);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"安顺\", 7274);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"铜仁\", 7284);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"毕节\", 7301);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"黔西南\", 7314);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"黔东南\", 7327);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"黔南\", 7352);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"昆明\", 7528);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"曲靖\", 7550);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"玉溪\", 7563);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"保山\", 7577);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"昭通\", 7585);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"普洱\", 7602);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"临沧\", 7618);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"丽江\", 7631);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"文山\", 7638);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"红河\", 7651);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"楚雄\", 7676);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"大理\", 7692);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"德宏\", 7711);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"拉萨\", 7916);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"那曲\", 7929);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"林芝\", 8020);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"西安\", 8206);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"铜川\", 8225);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"宝鸡\", 8232);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"咸阳\", 8251);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"渭南\", 8273);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"延安\", 8290);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"汉中\", 8310);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"榆林\", 8327);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"安康\", 8346);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"商洛\", 8362);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"兰州\", 8385);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"金昌\", 8548);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"天水\", 8559);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"嘉峪关\", 8570);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"武威\", 8576);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"张掖\", 8583);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"平凉\", 8593);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"酒泉\", 8604);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"庆阳\", 8615);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"定西\", 8626);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"陇南\", 8637);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"临夏\", 8664);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"西宁\", 8783);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"玉树\", 8823);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"银川\", 8908);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"石嘴山\", 8918);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"吴忠\", 8926);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"固原\", 8936);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"乌鲁木齐\", 9002);" );
  
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"北京\", 0);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"天津\", 125);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"上海\", 2354);" );
            db.execSQL( "insert into city_table(cityName,cityCode) values(\"重庆\", 6425);" );

        }
        catch ( SQLException e ) {
            e.printStackTrace();
        }
        // db.execSQL("create table search_history_table(id INTEGER PRIMARY KEY AUTOINCREMENT, search_record VARCHAR(20) NOT NULL);");
    }

    /*
     * 更新数据库
     * @see
     * android.database.sqlite.SQLiteOpenHelper#onUpgrade(android.database.sqlite.SQLiteDatabase,
     * int, int)
     */
    @Override
    public void onUpgrade( SQLiteDatabase db, int oldVersion, int newVersion ) {
        System.out.println( "Updata a database." );
    }

}
